<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  
  <title>项目管理 | 让技术更简单</title>

  <!-- keywords -->
  

  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="description" content="项目管理git协作工具 1.本地有一个记事本文件 有三个同学共同去编辑这个文件，每个同学写的内容不一样，要求最终在记事本文件里汇总。 3个同学 每个人都在本地创建了一个记事本文件，写内容，写完之后，拿U盘拷贝，再由一个人汇总。 git 命令行操作12345678910111213141516171819202122ls 查看当前的文件夹目录内容列表pwd 查看当前文件或者文件夹的系统路径cd xx">
<meta property="og:type" content="article">
<meta property="og:title" content="项目管理">
<meta property="og:url" content="http://example.com/2022/03/14/%E9%A1%B9%E7%9B%AE%E7%AE%A1%E7%90%86/index.html">
<meta property="og:site_name" content="让技术更简单">
<meta property="og:description" content="项目管理git协作工具 1.本地有一个记事本文件 有三个同学共同去编辑这个文件，每个同学写的内容不一样，要求最终在记事本文件里汇总。 3个同学 每个人都在本地创建了一个记事本文件，写内容，写完之后，拿U盘拷贝，再由一个人汇总。 git 命令行操作12345678910111213141516171819202122ls 查看当前的文件夹目录内容列表pwd 查看当前文件或者文件夹的系统路径cd xx">
<meta property="og:locale" content="en_US">
<meta property="article:published_time" content="2022-03-14T12:49:33.000Z">
<meta property="article:modified_time" content="2022-03-15T12:58:03.229Z">
<meta property="article:author" content="John Doe">
<meta name="twitter:card" content="summary">
  
    <link rel="alternative" href="/atom.xml" title="让技术更简单" type="application/atom+xml">
  
  
    <link rel="icon" href="http://7xkj1z.com1.z0.glb.clouddn.com/head.jpg">
  
  
<link rel="stylesheet" href="/css/style.css">

  
  

  
<script src="//cdn.bootcss.com/require.js/2.3.2/require.min.js"></script>

  
<script src="//cdn.bootcss.com/jquery/3.1.1/jquery.min.js"></script>


  
<meta name="generator" content="Hexo 6.1.0"></head>
<body>
  <div id="container">
    <div id="particles-js"></div>
    <div class="left-col">
    <div class="overlay"></div>
<div class="intrude-less">
	<header id="header" class="inner">
		<a href="/" class="profilepic">
			
			<img lazy-src="http://7xkj1z.com1.z0.glb.clouddn.com/head.jpg" class="js-avatar">
			
		</a>

		<hgroup>
		  <h1 class="header-author"><a href="/"></a></h1>
		</hgroup>

		

		
			<div class="switch-btn">
				<div class="icon">
					<div class="icon-ctn">
						<div class="icon-wrap icon-house" data-idx="0">
							<div class="birdhouse"></div>
							<div class="birdhouse_holes"></div>
						</div>
						<div class="icon-wrap icon-ribbon hide" data-idx="1">
							<div class="ribbon"></div>
						</div>
						
						<div class="icon-wrap icon-link hide" data-idx="2">
							<div class="loopback_l"></div>
							<div class="loopback_r"></div>
						</div>
						
						
					</div>
					
				</div>
				<div class="tips-box hide">
					<div class="tips-arrow"></div>
					<ul class="tips-inner">
						<li>菜单</li>
						<li>标签</li>
						
						<li>友情链接</li>
						
						
					</ul>
				</div>
			</div>
		

		<div class="switch-area">
			<div class="switch-wrap">
				<section class="switch-part switch-part1">
					<nav class="header-menu">
						<ul>
						
							<li><a href="/">主页</a></li>
				        
							<li><a href="/archives">所有文章</a></li>
				        
						</ul>
					</nav>
					<nav class="header-nav">
						<div class="social">
							
						</div>
					</nav>
				</section>
				
				
				<section class="switch-part switch-part2">
					<div class="widget tagcloud" id="js-tagcloud">
						
					</div>
				</section>
				
				
				
				<section class="switch-part switch-part3">
					<div id="js-friends">
					
			          <a target="_blank" class="main-nav-link switch-friends-link" href="https://github.com/smackgg/hexo-theme-smackdown">smackdown</a>
			        
			        </div>
				</section>
				

				
			</div>
		</div>
	</header>				
</div>
    </div>
    <div class="mid-col">
      <nav id="mobile-nav">
  	<div class="overlay">
  		<div class="slider-trigger"></div>
  		<h1 class="header-author js-mobile-header hide"></h1>
  	</div>
	<div class="intrude-less">
		<header id="header" class="inner">
			<div class="profilepic">
				<img lazy-src="http://7xkj1z.com1.z0.glb.clouddn.com/head.jpg" class="js-avatar">
			</div>
			<hgroup>
			  <h1 class="header-author"></h1>
			</hgroup>
			
			<nav class="header-menu">
				<ul>
				
					<li><a href="/">主页</a></li>
		        
					<li><a href="/archives">所有文章</a></li>
		        
		        <div class="clearfix"></div>
				</ul>
			</nav>
			<nav class="header-nav">
				<div class="social">
					
				</div>
			</nav>
		</header>				
	</div>
</nav>
      <div class="body-wrap"><article id="post-项目管理" class="article article-type-post" itemscope itemprop="blogPost">
  
    <div class="article-meta">
      <a href="/2022/03/14/%E9%A1%B9%E7%9B%AE%E7%AE%A1%E7%90%86/" class="article-date">
  	<time datetime="2022-03-14T12:49:33.000Z" itemprop="datePublished">2022-03-14</time>
</a>
    </div>
  
  <div class="article-inner">
    
      <input type="hidden" class="isFancy" />
    
    
      <header class="article-header">
        
  
    <h1 class="article-title" itemprop="name">
      项目管理
      
    </h1>
  

      </header>
      
      <div class="article-info article-info-post">
        
        

        
        <div class="clearfix"></div>
      </div>
      
    
    <div class="article-entry" itemprop="articleBody">
      
        <h2 id="项目管理"><a href="#项目管理" class="headerlink" title="项目管理"></a>项目管理</h2><p>git协作工具</p>
<p>1.本地有一个记事本文件</p>
<p>有三个同学共同去编辑这个文件，每个同学写的内容不一样，要求最终在记事本文件里汇总。</p>
<p>3个同学 每个人都在本地创建了一个记事本文件，写内容，写完之后，拿U盘拷贝，再由一个人汇总。</p>
<p>git</p>
<h3 id="命令行操作"><a href="#命令行操作" class="headerlink" title="命令行操作"></a>命令行操作</h3><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br></pre></td><td class="code"><pre><span class="line">ls 查看当前的文件夹目录内容列表</span><br><span class="line"></span><br><span class="line">pwd 查看当前文件或者文件夹的系统路径</span><br><span class="line"></span><br><span class="line">cd xxx（目录名称 或者 文件夹名称）进入某个目录或者某个文件夹</span><br><span class="line"></span><br><span class="line">cd .. 返回上一级（cd ../..） (cd / )</span><br><span class="line"></span><br><span class="line">mkdir xxx 创建一个文件夹（在当前目录下）</span><br><span class="line">touch xxx 创建一个文件 （在当前目录下）</span><br><span class="line"></span><br><span class="line">rm xxx 删除一个文件（rm -rf 强制删除，可以用来删除文件夹）</span><br><span class="line"></span><br><span class="line">cat 文件名 查看文件内容</span><br><span class="line"></span><br><span class="line">clear 清空当前命令行窗口</span><br><span class="line"></span><br><span class="line">code . 启动vs编辑器 并打开当前目录</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"></span><br></pre></td></tr></table></figure>



<h3 id="git命令行操作"><a href="#git命令行操作" class="headerlink" title="git命令行操作"></a>git命令行操作</h3><figure class="highlight json"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br></pre></td><td class="code"><pre><span class="line"><span class="number">1.</span>远程仓库</span><br><span class="line">A项目</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="number">2.</span>本地工作区</span><br><span class="line">git clone 本地 除了代码 还有一个隐藏的版本号<span class="number">0.01</span></span><br><span class="line"></span><br><span class="line">A项目</span><br><span class="line"> 修改</span><br><span class="line"></span><br><span class="line">git add  将文件添加暂存区</span><br><span class="line"></span><br><span class="line">git commit -m   提交暂存区到本地仓库  -m<span class="string">&quot;&quot;</span> <span class="comment">// -m&quot;&quot; // m:message 版本信息 &quot;&quot;:开发者存在暂存区的备注</span></span><br><span class="line">暂存区 git 版本号 <span class="number">0.02</span></span><br><span class="line"></span><br><span class="line">git pull</span><br><span class="line"></span><br><span class="line">git push 远程推送 （修改后的代码，还有相应的版本号和git操作记录）</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">git pull 拉取最新代码（更新）</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"></span><br><span class="line">多人协作 (张三 李四 王二麻子)</span><br><span class="line">A项目</span><br><span class="line">-	index.html</span><br><span class="line">		张三 修改了html并提交到 远程仓库了 <span class="number">0.02</span></span><br><span class="line">- index.js</span><br><span class="line">- index.css</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"></span><br><span class="line">分支的概念</span><br><span class="line"></span><br><span class="line">远程仓库 </span><br><span class="line">branch master(主干)</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"></span><br><span class="line">本地仓库</span><br><span class="line"></span><br><span class="line">branch master（本地主干）</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">git branch xxx 新建分支 zhangsan</span><br><span class="line">git branch xxx  lisi</span><br><span class="line">git branch xxx wangermazi</span><br><span class="line"> </span><br><span class="line">git checkout xxx 切换到某个分支</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="number">1.</span> 提交git push之前先git pull</span><br><span class="line"></span><br><span class="line"><span class="number">2.</span> 不要直接操作master 在新建分支上做开发  </span><br><span class="line"></span><br><span class="line"><span class="number">3.</span> 提交之前 吼一嗓子</span><br><span class="line"></span><br><span class="line"><span class="number">4.</span> 不要共同 操作一个文件</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"></span><br></pre></td></tr></table></figure>
<h3 id="项目管理步骤"><a href="#项目管理步骤" class="headerlink" title="项目管理步骤"></a>项目管理步骤</h3><figure class="highlight json"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br></pre></td><td class="code"><pre><span class="line">步骤 </span><br><span class="line"><span class="number">1</span><span class="punctuation">,</span> 用git打开本地上想要操作文件的目录</span><br><span class="line"></span><br><span class="line"><span class="number">2</span><span class="punctuation">,</span> git clone https<span class="punctuation">:</span><span class="comment">//gitee.com/yu-x1aoxi/niuniumama.git   // 将码云上的代码复制到本地</span></span><br><span class="line"></span><br><span class="line"><span class="number">3</span><span class="punctuation">,</span> git branch xxx 新建分支 zhangsan <span class="comment">// 创建分支</span></span><br><span class="line"></span><br><span class="line"><span class="number">4</span><span class="punctuation">,</span> git branch 可以查看创建的所有分支</span><br><span class="line"></span><br><span class="line"><span class="number">5</span><span class="punctuation">,</span> git checkout xxx  <span class="comment">// 切换到这个分支</span></span><br><span class="line"></span><br><span class="line"><span class="number">6</span><span class="punctuation">,</span> mkdir xxx 创建一个文件夹（在当前目录下）  touch xxx 创建一个文件 （在当前目录下）  <span class="comment">// 创建文件或文件夹</span></span><br><span class="line"></span><br><span class="line"><span class="number">7</span><span class="punctuation">,</span> git add . 将文件或文件夹添加到暂存区</span><br><span class="line"></span><br><span class="line"><span class="number">8</span><span class="punctuation">,</span> git commit -m&#x27;&#x27;   提交暂存区到本地仓库     -m<span class="string">&quot;&quot;</span> <span class="comment">// m:message 版本信息 &quot;&quot;:开发者存在暂存区的备注</span></span><br><span class="line"></span><br><span class="line"><span class="number">9</span><span class="punctuation">,</span> git checkout master <span class="comment">// 切换到主干</span></span><br><span class="line"></span><br><span class="line"><span class="number">10</span><span class="punctuation">,</span> git merge xxx  <span class="comment">// 将分支合并到主干</span></span><br><span class="line"></span><br><span class="line"><span class="number">11</span><span class="punctuation">,</span> git pull  <span class="comment">// 更新主干 =&gt; 将云端的代码更新到本地</span></span><br><span class="line"></span><br><span class="line"><span class="number">12</span><span class="punctuation">,</span> 吼一声<span class="punctuation">,</span>告诉你的team你要更新了</span><br><span class="line"></span><br><span class="line"><span class="number">13</span><span class="punctuation">,</span> git push  <span class="comment">// 远程推送 （修改后的代码，还有相应的版本号和git操作记录）</span></span><br><span class="line"></span><br><span class="line"></span><br><span class="line">版本冲突</span><br><span class="line"></span><br><span class="line">假设当前你的版本号为<span class="number">1</span><span class="punctuation">,</span> 云端版本号为<span class="number">2.</span></span><br><span class="line"></span><br><span class="line">此时你上传文件版本号为<span class="number">2</span><span class="punctuation">,</span>因为两个版本号相同<span class="punctuation">,</span>所以报错无法上传.</span><br><span class="line"></span><br><span class="line">所以使用git pull 更新你的本地仓库版本号为<span class="number">2.</span>即可正常上传.上传后云端版本为<span class="number">3.</span></span><br><span class="line"></span><br><span class="line"></span><br><span class="line">还是当前这种情况</span><br><span class="line"></span><br><span class="line">如果你在版本号为<span class="number">1</span>的时候<span class="punctuation">,</span>将文件放入暂存区</span><br><span class="line"></span><br><span class="line">即使你git pull 更新了本地仓库再上传<span class="punctuation">,</span>你的暂存区中的版本号仍然为<span class="number">2</span><span class="punctuation">,</span>和云端冲突</span><br><span class="line"></span><br><span class="line">所以你要重新git add . 将文件重新放入暂存区. 此时你的暂存区的版本号为<span class="number">3.</span></span><br><span class="line"></span><br><span class="line">即可正常存入云端.</span><br><span class="line"></span><br><span class="line"></span><br></pre></td></tr></table></figure>

      
    </div>
    
  </div>
  
    
<nav id="article-nav">
  
    <a href="/2022/03/15/vue-day01/" id="article-nav-newer" class="article-nav-link-wrap">
      <strong class="article-nav-caption">&lt;</strong>
      <div class="article-nav-title">
        
          vue-入门Day.01
        
      </div>
    </a>
  
  
    <a href="/2022/03/14/%E5%A6%82%E4%BD%95%E6%90%AD%E5%BB%BA%E5%8D%9A%E5%AE%A2/" id="article-nav-older" class="article-nav-link-wrap">
      <div class="article-nav-title">如何搭建博客</div>
      <strong class="article-nav-caption">&gt;</strong>
    </a>
  
</nav>

  
</article>


<div class="ds-share share" data-thread-key="项目管理" data-title="项目管理" data-url="http://example.com/2022/03/14/%E9%A1%B9%E7%9B%AE%E7%AE%A1%E7%90%86/"  data-images="http://7xkj1z.com1.z0.glb.clouddn.com/head.jpg" data-content="项目管理">
    <div class="ds-share-inline">
      <ul  class="ds-share-icons-16">
      	<li data-toggle="ds-share-icons-more"><a class="ds-more" href="javascript:void(0);">分享到：</a></li>
        <li><a class="ds-weibo" href="javascript:void(0);" data-service="weibo">微博</a></li>
        <li><a class="ds-qzone" href="javascript:void(0);" data-service="qzone">QQ空间</a></li>
        <li><a class="ds-qqt" href="javascript:void(0);" data-service="qqt">腾讯微博</a></li>
        <li><a class="ds-wechat" href="javascript:void(0);" data-service="wechat">微信</a></li>
      </ul>
      <div class="ds-share-icons-more">
      </div>
    </div>
 </div>
 





</div>
      <footer id="footer">
  <div class="outer">
    <div id="footer-info">
      <div class="footer-left">
        &copy; 2022 John Doe
      </div>
        <div class="footer-right">
          <a href="http://hexo.io/" target="_blank">Hexo</a>  Theme <a href="https://github.com/smackgg/hexo-theme-smackdown" target="_blank">Smackdown</a>
        </div>
    </div>
  </div>
</footer>
    </div>
    
  
<link rel="stylesheet" href="/fancybox/jquery.fancybox.css">



<script>
	var yiliaConfig = {
		fancybox: true,
		mathjax: true,
		animate: true,
		isHome: false,
		isPost: true,
		isArchive: false,
		isTag: false,
		isCategory: false,
		open_in_new: false
	}
</script>

<script src="/js/main.js"></script>




<script type="text/x-mathjax-config">
MathJax.Hub.Config({
    tex2jax: {
        inlineMath: [ ['$','$'], ["\\(","\\)"]  ],
        processEscapes: true,
        skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
    }
});

MathJax.Hub.Queue(function() {
    var all = MathJax.Hub.getAllJax(), i;
    for(i=0; i < all.length; i += 1) {
        all[i].SourceElement().parentNode.className += ' has-jax';                 
    }       
});
</script>

<script src="//cdn.bootcss.com/mathjax/2.7.0/MathJax.js"></script>


  </div>
</body>
</html>